<template>
	<view class="content">
		<view class="dis disAl disJuC fleDir coFFF" style="height: 275rpx;background-color: #1262DB;">
			<view class="dis disAl disJuC" v-if="userinfo.group_type == 2 && userinfo.group_id == 1">
				<view class="mar-right20 foSi30 textCen" style="width: 160rpx;">可提现金额</view>
				<!-- <image v-if="True" @click="True = false" src="../../static/personalCenter/xianshi1.png" style="width: 41rpx;height: 24rpx;"></image>
				<image v-if="!True" @click="True = true" src="../../static/personalCenter/yincang1.png" style="width: 41rpx;height: 24rpx;"></image> -->
			</view>
			<view class="" v-else>
				<view class="mar-right20 foSi30 textCen" style="width: 160rpx;">可提现金额</view>
				<image v-if="True" @click="True = false" src="../../static/personalCenter/xianshi1.png" style="width: 41rpx;height: 24rpx;"></image>
				<image v-if="!True" @click="True = true" src="../../static/personalCenter/yincang1.png" style="width: 41rpx;height: 24rpx;"></image>
			</view>
			<view class="dis disAl disJuC mar-top30">
				<view v-if="True" class="mar-right20 foSi50 textCen" style="width: 160rpx;">¥{{parseFloat(withdrawable).toFixed(2)}}</view>
				<view v-if="!True" class="mar-right20 foSi50 textCen" style="width: 160rpx;">****</view>
				<view style="width: 41rpx;height: 1rpx;"></view>
			</view>
		</view>
		
		<view class="wid90 mar mar-top30 borRad20"
		style="height: 316rpx;background: url('https://lyk.10pay.cn/wechatimg/qianbaobeijing.png');box-sizing: border-box;background-size: 100% 100%;">
			<view class="wid80 hei100 mar dis disAl disJuB">
				<view class="foSi40 textCen" style="font-weight: 600;">
					<view>收益钱包</view>
					<view v-if="True" class="mar-top30">¥{{parseFloat(income).toFixed(2)}}</view>
					<view v-if="!True" class="mar-top30">****</view>
				</view>
				<view class="dis foSi30 coFFF"  v-if="userinfo.group_type == 2 && userinfo.group_id == 1">
					<!-- <view @click="tiaozhuan('/pages/wallet/withdrawDeposit?tx=0&types=1&income='+income)" 
					class="dis disAl disJuC borRad10 mar-right20" style="width: 120rpx;height: 56rpx;background-color: #1262DB">提现</view> -->
					<view @click="tiaozhuan('/pages/wallet/cashPledge?types=1')" 
					class="dis disAl disJuC borRad10" style="width: 190rpx;height: 56rpx;background-color: #1262DB">查看详情</view>
				</view>
				<view class="dis foSi30 coFFF"  v-else>
					<view @click="tiaozhuan('/pages/wallet/withdrawDeposit?tx=0&types=1&income='+income)" 
					class="dis disAl disJuC borRad10 mar-right20" style="width: 120rpx;height: 56rpx;background-color: #1262DB">提现</view>
					<view @click="tiaozhuan('/pages/wallet/cashPledge?types=1')" 
					class="dis disAl disJuC borRad10" style="width: 190rpx;height: 56rpx;background-color: #1262DB">查看详情</view>
				</view>
			</view>
		</view>
		
		
		<view class="wid90 mar mar-top30 borRad20"
		style="height: 316rpx;background: url('https://lyk.10pay.cn/wechatimg/qianbaobeijing.png');box-sizing: border-box;background-size: 100% 100%;">
			<view class="wid80 hei100 mar dis disAl disJuB">
				<view class="foSi40 textCen" style="font-weight: 600;">
					<view>押金钱包</view>
					<view v-if="True" class="mar-top30">¥{{parseFloat(userinfo.rea_money).toFixed(2)}}</view>
					<view v-if="!True" class="mar-top30">****</view>
				</view>
				<view class="dis foSi30 coFFF"   v-if="userinfo.group_type == 2 && userinfo.group_id == 1">
					<!-- <view @click="tiaozhuan('/pages/wallet/withdrawDeposit?tx=0&types=2&income='+userinfo.rea_money)" 
					class="dis disAl disJuC borRad10 mar-right20" style="width: 120rpx;height: 56rpx;background-color: #1262DB">提现</view> -->
					<view @click="tiaozhuan('/pages/wallet/cashPledge?types=2')" 
					class="dis disAl disJuC borRad10" style="width: 190rpx;height: 56rpx;background-color: #1262DB">查看详情</view>
				</view>
				<view class="dis foSi30 coFFF"   v-else>
					<view @click="tiaozhuan('/pages/wallet/withdrawDeposit?tx=0&types=2&income='+userinfo.rea_money)" 
					class="dis disAl disJuC borRad10 mar-right20" style="width: 120rpx;height: 56rpx;background-color: #1262DB">提现</view>
					<view @click="tiaozhuan('/pages/wallet/cashPledge?types=2')" 
					class="dis disAl disJuC borRad10" style="width: 190rpx;height: 56rpx;background-color: #1262DB">查看详情</view>
				</view>
			</view>
		</view>
		
		<!-- <view class="wid90 mar mar-top30 borRad20"
		style="height: 316rpx;background: url('../../static/waliet/qianbaobeijing.png');box-sizing: border-box;background-size: 100% 100%;">
			<view class="wid90 hei100 mar dis disAl disJuB">
				<view class="foSi40 textCen">
					<view>押金钱包></view>
					<view v-if="True" class="mar-top30">¥0.00</view>
					<view v-if="!True" class="mar-top30">¥0.00</view>
				</view>
				<view class="dis foSi30 coFFF">
					<view @click="tiaozhuan('/pages/wallet/withdrawDeposit?tx=1')" class="dis disAl disJuC borRad10 mar-right20" style="width: 120rpx;height: 56rpx;background-color: #1262DB;">提现</view>
					<view @click="tiaozhuan('/pages/wallet/earnings')" class="dis disAl disJuC borRad10" style="width: 190rpx;height: 56rpx;background-color: #1262DB">查看详情</view>
				</view>
			</view>
		</view> -->
		
		<view class="wid90 mar box borRad20 bacFFF mar-top30" style="height: 142rpx;">
			<view class="wid90 mar hei100 dis disAl">
				<image :src="userinfo.avatar" class="borRad50" style="width: 88rpx;height: 88rpx;"></image>
				<view class="mar-left30 foSi30">
					<view>{{userinfo.bank_name}}</view>
					<view class="mar-top10" style="color: #1262DB;">{{userinfo.bank_num}}</view>
				</view>
			</view>
		</view>
		<view class="tx" @click="go_txjl">
			提现记录
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				True: false,
				userinfo: '',
				withdrawable:'',
				income:''
			}
		},
		onLoad() {
			
		},
		onShow(){
			this.getuserinfo()
			this.wallet()
		},
		methods: {
			go_txjl(){
				uni.navigateTo({
					url:'/pages/wallet/txrecord'
				})
			},
			wallet(){
				var that = this
				uni.request({
				    url: that.global.url + 'api/wallet/wallet',
				    method: "POST",
					header: {
						'token': uni.getStorageSync('token')
					},
				    data: {},
				    success(res) {
				        let result = res.data
				        if(result.code == 1){
							that.withdrawable = result.data.withdrawable
							that.income = result.data.income
						}else{
				           uni.showToast({
				           	title: result.msg,
				           	icon: 'error'
				           })
				        }
				       
				    }
				})
			},
			getuserinfo(){
				var that = this
				uni.request({
				    url: that.global.url + 'api/user/getuserinfo',
				    method: "POST",
					header: {
						'token': uni.getStorageSync('token')
					},
				    data: {},
				    success(res) {
				        let result = res.data
				        if(result.code == 1){
							that.userinfo = result.data
						}else{
				           uni.showToast({
				           	title: result.msg,
				           	icon: 'error'
				           })
				        }
				       
				    }
				})
			},
			tiaozhuan(url){
				uni.navigateTo({
					url: url
				});
			},
		}
	}
</script>

<style>
	.content {}
	.tx{
		    border-bottom: 1px solid #20489e;
		    color: #20489e;
		    width: 150rpx;
		    text-align: center;
		    margin: 0px auto;
		    margin-top: 80rpx;
	}
</style>
